package us.kg.kotoriforest.springmvc.restful.vo.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;
import us.kg.kotoriforest.springmvc.restful.annotation.Gender;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author Kotori rotroutine@163.com
 * @since 2025/2/8
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
public class EmployeeAddVo {
    @NotEmpty(message = "姓名不能为空")
    private String name;
    @Range(min = 18, max = 60, message = "年龄只能在18-60岁之间")
    private Integer age;
    @Email(message = "邮箱格式不正确")
    private String email;
    // @Pattern(regexp = "^[男女]$", message = "性别只能是男或女")
    @Gender(message = "{gender.message}")
    private String gender;
    private String address;
    private BigDecimal salary;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date birthday;
}
